uniform vec3 glowColor;
uniform float division;
uniform float coeficient;
uniform float opacity;
uniform float power;
uniform float scale;
varying vec3 vVertexNormal;
varying vec3 vVertexWorldPosition;
varying vec4 vFragColor;
void main() {
  vec3 worldVertexToCamera = cameraPosition - vVertexWorldPosition;
  vec3 viewCameraToVertex = (viewMatrix * vec4(worldVertexToCamera, 0.0)).xyz;
  viewCameraToVertex = normalize(viewCameraToVertex);
  float intensity = coeficient + dot(vVertexNormal, viewCameraToVertex);
  if(intensity < division) {
    discard;
  }
  intensity = intensity / division * scale;
  intensity = pow(intensity, power);
  gl_FragColor = vec4(glowColor, opacity * (1.0 - intensity));
}

